<#ibizinclude>
../@MACRO/CONTROL/LANGBASE.vue.ftl
</#ibizinclude>
<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <#if ctrl.render?? || ctrl.getRender()??> 
    ${ctrl.render.code}
    <#else>
    <i-form>
        <el-table v-if="isDisplay === true"
    <#--  BEGIN：是否支持排序  --> 
            <#if !ctrl.isNoSort()> 
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            </#if>
    <#--  END：是否支持排序  -->
            :border="isDragendCol"
            <#-- 表格聚合start -->
            <#if ctrl.getAggMode() != "NONE">
            :show-summary="true && items.length > 0"
            :summary-method="getSummaries"
            </#if>
            <#-- 表格聚合end -->
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select($event)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref='multipleTable' :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('<#if langbase??>${langbase}.nodata</#if>')}} 
                <span class="quick-toolbar">
                <#if ctrl.getQuickPSDEToolbar?? && ctrl.getQuickPSDEToolbar()??>
                  <#assign quickToolbar = ctrl.getQuickPSDEToolbar()/>
                  <@ibizindent blank=12>
                  ${P.getCtrlCode(quickToolbar, 'CONTROL.html').code}
                  </@ibizindent>
                </#if>
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <#assign adaptationColu = true/>
            <#list ctrl.getPSDEGridColumns() as column>
            <@ibizindent blank=12>
            ${P.getPartCode(column,'COLUMN').code}<#t>
            </@ibizindent>
            </#list>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
    <#if ctrl.isEnablePagingBar()>
        <row class='grid-pagination' v-show="items.length > 0">
            <page class='pull-right' @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
    <#if ctrl.getBatchPSDEToolbar?? && ctrl.getBatchPSDEToolbar()??>
                    <span v-show="selections.length > 0" class="batch-toolbar">
        <#assign batchToolbar = ctrl.getBatchPSDEToolbar()/>
        <@ibizindent blank=12>
                        ${P.getCtrlCode(batchToolbar, 'CONTROL.html').code}
        </@ibizindent>
                    </span>
    </#if>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </#if>
    </#if>
    </i-form>
</div>